<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var rowl = prompt('请输入行数');
        var cols = prompt('请输入列数');

        var str = '';
        for (var i = 1; i <= rowl; i++) {
            for (var j = 1; j <= rowl; j++) {
                    str=str+'❤'
            }
            str +='\n'
        }
        console.log(str);
    </script>
</body>

</html>